<admintpl file="header" />
</head>

<body>
	<div class="wrap js-check-wrap">
		<ul class="nav nav-tabs">
			<li class="active"><a href="{:U('Product/index')}">商品列表</a></li>
			<li><a href="{:U('Product/add')}">新增商品</a></li>
		</ul>
		<form class="well form-search pd0" method="post"  id="form1">
			<table class="table table-condensed">
				<tbody>
					<tr>
						<td>
							商品名称 ：
						</td>
						<td>
							<input type="text" name="name" class="wd200" value="{$formget.name}">
						</td>
						<td>
							商品分类：
						</td>
						<td>
							<select class="select2-default" name="ftype">
								<option value="">全部</option>
								{$ftypes}
							</select>
						</td>
						<td>
							商品状态 ：
						</td>
						<td>
							<select class="select2-default" name="status">
								<option value="">全部</option>
								<option value="1" <if condition="$formget['status'] eq 1">selected</if>>已上架</option>
								<option value="2" <if condition="$formget['status'] eq 2">selected</if> >已下架</option>
							</select>
						</td>
						<td>
						</td>
						<td>
							<input type="submit" class="btn btn-primary" onclick="javascript:form1.action='{:U("Product/index")}';" value="搜索" />
						</td>
					</tr>
				</tbody>
			</table>
		</form>
		<form method="post" class="js-ajax-form">
			<table class="table table-hover table-bordered table-list">
				<thead>
					<tr>
						<th width="50">ID</th>
						<th>商品名称</th>
						<th>商品状态</th>
						<th>商品库存</th>
						<th>商品分类</th>
						<th>计量单位</th>
						<th>创建时间</th>
						<th>操作</th>
					</tr>
				</thead>
				<tbody>
					<?php
						$status=array('1'=>'上架','2'=>'下架');
					?>
					<foreach name="list" item="vo">
						<tr>
							<td>{$vo.id}</td>
							<td>{$vo.name}</td>
							<td>{$status[$vo['status']]}</td>
							<td>{$vo.stock}</td>
							<td>{$result_k_v[$vo['ftype']]}</td>
							<td>{$vo.unit}</td>
							<td>{$vo.create_time}</td>
							<td>
								<a href="{:U('Product/edit',array('id'=>$vo['id']))}">编辑</a> |
								  <if condition="$vo['status'] eq 1">
									<a href="{:U('Product/open_close',array('id'=>$vo['id'],'type'=>'2'))}" class="a.js-ajax-dialog-btn btn-danger">下架</a>
									<else />
									<a href="{:U('Product/open_close',array('id'=>$vo['id'],'type'=>'1'))}" class="a.js-ajax-dialog-btn btn-warning">上架</a>
								</if>
							</td>
						</tr>
					</foreach>
				</tbody>
				<tfoot>
					<tr>
						<th width="50">ID</th>
						<th>商品名称</th>
						<th>商品状态</th>
						<th>商品库存</th>
						<th>商品分类</th>
						<th>计量单位</th>
						<th>创建时间</th>
						<th>操作</th>
					</tr>
				</tfoot>
			</table>
			<div class="pagination">{$Page}</div>
		</form>
	</div>
	<script src="__PUBLIC__/js/common.js"></script>
</body>

</html>